package com.example.demo.entity;

import java.util.Objects;

import javax.persistence.*;

@Entity
@Table(name = "t_token", schema = "demo-auth", catalog = "")
public class TToken {
    private String id;
    private String appid;
    private String appSecret;
    private String token;
    private Long expire;
    private String name;
    
    private String accessTokenJson;
    
    @Basic
    @Column(name = "accesstokenjson", nullable = true, length = 2000)
    public String getAccessTokenJson() {
		return accessTokenJson;
	}

	public void setAccessTokenJson(String accessTokenJson) {
		this.accessTokenJson = accessTokenJson;
	}

	@Id
    @Column(name = "id", nullable = false, length = 100)
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Basic
    @Column(name = "appid", nullable = false, length = 200)
    public String getAppid() {
        return appid;
    }

    public void setAppid(String appid) {
        this.appid = appid;
    }

    @Basic
    @Column(name = "app_secret", nullable = true, length = 255)
    public String getAppSecret() {
        return appSecret;
    }

    public void setAppSecret(String appSecret) {
        this.appSecret = appSecret;
    }

    @Basic
    @Column(name = "token", nullable = true, length = 255)
    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    @Basic
    @Column(name = "expire", nullable = true)
    public Long getExpire() {
        return expire;
    }

    public void setExpire(Long expire) {
        this.expire = expire;
    }

    @Basic
    @Column(name = "name", nullable = true, length = 100)
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TToken tToken = (TToken) o;
        return Objects.equals(id, tToken.id) &&
                Objects.equals(appid, tToken.appid) &&
                Objects.equals(appSecret, tToken.appSecret) &&
                Objects.equals(token, tToken.token) &&
                Objects.equals(expire, tToken.expire) &&
                Objects.equals(name, tToken.name);
    }

    @Override
    public int hashCode() {

        return Objects.hash(id, appid, appSecret, token, expire, name);
    }

}
